
public class BinarySearchTree 
{
	private Node root;

	public BinarySearchTree()
	{

	}

	public void addItem(Object value, int key)
	{
		if(root == null)
		{
			root = new Node(value, key);
		}
		else
		{
			root.appendNode(value, key);
		}

	}
	
	public String getItems()
	{
		return root.getValues();
	}
	
	public String getKeys()
	{
		return root.getKeys();
	}

	public int getSize()
	{
		return root.getSize();
	}
	
	public boolean containsKey(int key)
	{
		if(key != 0)
		{

			if(root.containsKey(key))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	
	public boolean containsValue(Object value)
	{
		if(value != null)
		{
			if(root.containsValue(value))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		return false;
	}
	
	public String getValue(int key)
	{
		if(root.getValue(key) != null)
		{
			return "" + root.getValue(key);
		}
		else
		{
			return "Niet gevonden";
		}
		
	}
	
	public int getHeight()
	{
		return root.getHeight();
	}
	
	public void remove(int key)
	{
		root.remove(key);
	}

	public String toString()
	{
		return root.getTree();
	}
}
